package biz.impl;

import java.util.ArrayList;
import java.util.List;

import biz.NewsBiz;
import dao.NewsDao;
import dao.impl.NewsDaoImpl;
import entity.News;

public class NewsBizImpl implements NewsBiz {
	NewsDao newsDao = new NewsDaoImpl();
	@Override
	public List<News> queryAllNews() {
		return newsDao.queryAllNews();
	}

	@Override
	public List<News> queryAllNews(int pageNum, int pageSize) {
		return newsDao.queryAllNews(pageNum, pageSize);
	}

	@Override
	public List<News> queryHotNews() {
		List<News> newsList=new ArrayList<News>();
		for(int i=0;i<6;i++){
			newsList.add(queryAllNews().get(i));
		}
		return newsList;
	}

	@Override
	public News queryNewByNewsId(int newsId) {
		return newsDao.queryNewByNewsId(newsId);
	}

}
